<div class="m">
    <div class="toolbar-list">
        <ul>
            <li class="button" >
                <br clear="all"/>
                <a href="#" id="save_gallery" class="toolbar">
                    <span class="icon-32-apply"></span>
                    Сохранить
                </a>
            </li>

            <li class="button">
                <br clear="all"/>
                <a href="<?php echo base_url();?>index.php/gallery" class="toolbar">
                    <span class="icon-32-cancel"></span>
                    Отменить
                </a>
            </li>
        </ul>
        <br clear="all"/>
    </div>
    <div class="pagetitle icon-48-article-add"><h3>Менеджер галерей: Добавление описание</h3></div>
</div>


<div class="photos_list">
    <form action="<?php echo base_url();?>admin/gallery/save" id="galleryForm" method="post">
        <?php  foreach ($gallery as $photo):?>
        <div class="photo"  style="border: 1px solid #b3b4bd; width: 475px; border-radius: 10px 10px 10px 10px; padding: 10px; margin: 10px; height: 160px;" >
            <a class="images" href="<?php echo "/photos/".$photo['src']  ?>"><img src="<?php echo "/photos/".$photo['src_thn']  ?>" style="float: left;" width="100px" alt=""/></a>

            <div class="photo_info" style="float: left">
                <table>
                    <tr>
                        <td>Название: </td>
                        <td>
                            <input type="text" name="Gallery[<?php echo $photo['id'] ?>][name]"  >
                        </td>
                    </tr>
                    <tr>
                        <td style="vertical-align: top">Описание: </td>
                        <td>
                            <textarea rows="5" cols="30" name="Gallery[<?php echo $photo['id'] ?>][description]" ></textarea>
                        </td>
                    </tr>
                    <tr>
                        <td> Видимость: </td>
                        <td>
                            <input type="text" name="Gallery[<?php echo $photo['id'] ?>][visible]" style="float: left;">
                        </td>
                    </tr>
                </table>
            </div>
        </div>
            <br clear="all" />
        <?php endforeach;?>
    </form>
</div>
<script type="text/javascript">
    jQuery(function(){
        jQuery(".images").lightBox({
            imageLoading : '../../images/admin/lightbox-ico-loading.gif',
            imageBtnClose: '../../images/admin/lightbox-btn-close.gif',
            imageBtnPrev: '../../images/admin/lightbox-btn-prev.gif',
            imageBtnNext: '../../images/admin/lightbox-btn-next.gif',
            imageBlank  : '../../images/admin/lightbox-blank.gif'
        });
        jQuery('#save_gallery').click(function(){
            jQuery('#galleryForm').submit();
        })
    });
</script>